package com.pattern.twice.singleton;

public class Singleton {

    private volatile Singleton singleton;

    private Singleton() {
    }

    public Singleton getSingleton(){
        if (singleton==null){
            synchronized (Singleton.class){
                singleton = new Singleton();
                return singleton;
            }
        }
        return singleton;
    }


}
